//
//  UIImage+DON.h
//  DONBaseClass
//
//  Created by Emo, on 2023/3/22.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, DONGradientDirection) {
    /// 上到下
    DONGradientDirectionTopToBottom = 0,
    /// 左到右
    DONGradientDirectionLeftToRight,
    /// 左上到右下
    DONGradientDirectionLeftTopToRightBottom,
    /// 左下到右上
    DONGradientDirectionLeftBottomToRightTop,
};

NS_ASSUME_NONNULL_BEGIN

@interface UIImage (DON)

/**
 * 颜色转为图片（纯色）
 */
+ (UIImage *)don_imageWithColor:(UIColor *)color;

/**
 * 渐变色（自定义方向）
 */
+ (UIImage *)don_imageWithColors:(NSArray <UIColor *>*)colors
                       direction:(DONGradientDirection)direction
                            size:(CGSize)size;

@end

NS_ASSUME_NONNULL_END
